package org.csu.xzypetstore.service;

import org.csu.xzypetstore.domain.Account;
import org.csu.xzypetstore.domain.Admin;
import org.csu.xzypetstore.persistence.adminManageMapper;
import org.csu.xzypetstore.persistence.adminMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdminService {

    @Autowired
    private adminMapper AdminMapper;

    @Autowired
    public adminManageMapper adminManageMapper;

    public Admin getAccountByUserAndPwd(String username,String password)
    {
        Admin admin = new Admin();
        admin.setPassword(password);
        admin.setUsername(username);
        return AdminMapper.getAdminByUsernameAndPassword(admin);
    }

    public List<String> getAllUsers()
    {
        return adminManageMapper.getAllUser();
    }




}
